<template>
  <div class="">
    <div class="page-filter mb10 fl">
      <el-form ref="filter" :model="filter" label-width="0">
        <el-form-item class="mr10 mb5 fl">
          <ProFilter v-model="filter.pro_id" :get-data="getList" />
        </el-form-item>
        <el-form-item class="mr10 mb5 fl" style="width: 300px">
          <el-button size="small" @click="app.resetFields($refs['filter'].$parent,'filter')">清 空</el-button>
          <el-button type="primary" size="small" @click="getList">查 询</el-button>
          <el-button
            type="primary"
            size="small"
            @click="handleDialog({
              dTitle: '新增发包文件',
              dType: 'add',
              dField: dField
            })"
          >新 增</el-button>
        </el-form-item> 
      </el-form>
    </div>
    <el-table v-loading="app.loading" class="search-table" :data="list" border fit highlight-current-row style="width: 100%;">
      <el-table-column label="序号" align="center" width="56px">
        <template slot-scope="{$index}">
          {{ $index + 1 }}
        </template>
      </el-table-column>
      <el-table-column label="PO单号" min-width="190px">
        <template slot-scope="{row}">
          {{ 'PO'+row.pro_id }}
        </template>
      </el-table-column>
      <el-table-column label="项目名称" min-width="220px" prop="name" />
      <el-table-column label="发包文件" align="center" width="110px">
        <template slot-scope="{row}">
          <a style="color: blue"  href="javascript:void(0)" @click="files({e_id: row.id, type: '',
                                      db_type: 'logc_engineering_fabao_archives'})">发包文件</a><br>
        </template>
      </el-table-column>
      <el-table-column label="提交人" width="120px" prop="nickname" />
      <el-table-column label="提交时间" align="center" width="140px" prop="create_time" />
      <el-table-column label="备注" min-width="260px" prop="remark" />
      <el-table-column label="操作" align="center" width="90px" fixed="right">
        <template slot-scope="{row}">
          <el-dropdown>
            <el-button type="primary" size="mini">
              操作<i class="el-icon-arrow-down el-icon--right" />
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="handleDelete(row)">删 除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="filter.pageAll>0" :total="filter.pageAll" :page.sync="filter.pageCurrent" :limit.sync="filter.pageNumber" @pagination="getList" />
    <Cos ref="cos" :info="dialog" />
    <Dialog ref="dialog" :get-data="getList" :info="dialog" />
  </div>
</template>

<script>
import ProFilter from '@/components/ProFilter'
import { fabao, delFabao } from '@/api/project/engineering'
import Pagination from '@/components/Pagination'
import page from '@/utils/page'
import Dialog from './components/fabao-dialog'

export default {
  name: '',
  components: { Pagination, ProFilter, Dialog },
  extends: page,
  props: {
    reqList: {
      default: fabao,
      type: Function
    },
    reqDel: {
      default: delFabao,
      type: Function
    }
  },
  data() {
    return {
      dField: ['id', 'pro_id', 'remark']
    }
  },
  created() {
  },
  methods: {
    outData(e) {
    }
  }
}
</script>
